<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>弓友之家</title>
    <link rel="stylesheet" href="css/mui.css" />
    <link rel="stylesheet" href="fonts/iconfont.css" />
    <link rel="stylesheet" href="css/style.css" />
    <style>
    	.game-rank{margin-top: 10px;}
    </style>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">团体排行榜</h1>
		<a class="mui-icon mui-icon-more-filled mui-pull-right shareBtn"></a>
	</header>
	<div class="mui-content">
		<style>
			.per-img{padding: 10px;}
			.per-img img{width: 100%;}
		</style>
		<div class="per-img"><img src=""/></div>
		<div class="new-game-rank">
		</div>
		<div class="game-news">
			<div class="head2"><span>年度排行回顾</span></div>
			<div class="experience-content">
	        	
	        </div>
		</div>
	</div>
	<!--分享-->
	<div class="shareWx mui-hidden"> 
		<ul class="mui-list-unstyled">
			<li class="tel"><a href="javascript:void(0)" onclick="shareWeixinMessage(1)">微信好友</a></li>
			<li class="qq"><a href="javascript:void(0)" onclick="shareWeixinMessage(2)">朋友圈</a></li>
		</ul>
		<button type="button" class="cancleShare">取消</button>
	</div>
	<script type="text/javascript" src="js/mui.min.js" ></script>
	<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/mui.zoom.js" ></script>
	<script type="text/javascript" src="js/mui.previewimage.js" ></script>
	<script type="text/javascript" charset="utf-8">
		mui.ajax(H_SRC+'/amier/index/sponsor_2',{
			data:{
				token:token
			},
			dataType:'json',
			type:'post',
			timeout:10000,             
			success:function(data){
				var dataurl=data.data;
				$(".per-img img").attr("src",H_SRC+dataurl.img_team)
			},
			error:function(){
				
			}
		}) 
		
      	mui.init();
      	mui.ajax(H_SRC+'/amier/index/honor_wall_team',{
			data:{
				token:token
			},
			dataType:'json',
			type:'post',
			timeout:10000,             
			success:function(data){
				var dataurl=data.data;
				if(data.code == 1){
      				//冠亚军排行
      				var rank="";
      				for(var i=0;i<dataurl.paiming.length;i++){
      					rank+='<div class="new-rank">';
      					if(dataurl.paiming[i].ranking==1){
      						rank+='<h3>团体赛冠军</h3>';
      					}else if(dataurl.paiming[i].ranking==2){
      						rank+='<h3>团体赛亚军</h3>';
      					}else if(dataurl.paiming[i].ranking==3){
      						rank+='<h3>团体赛季军</h3>';
      					}else{
      						rank+='<h3>第'+(i+1)+'名</h3>';
      					}
						rank+='<h4>'+dataurl.paiming[i].name+'</h4><a href="javascript:void(0)" data-id="'+dataurl.paiming[i].team_id+'">查看详情</a><div class="mui-row">';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.paiming[i].img1+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.paiming[i].img1+'" data-preview-src="" data-preview-group="'+dataurl.paiming[i].team_id+'"/></div><p class="name">'+dataurl.paiming[i].name1+'</p></div></div>';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.paiming[i].img2+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.paiming[i].img2+'" data-preview-src="" data-preview-group="'+dataurl.paiming[i].team_id+'"/></div><p class="name">'+dataurl.paiming[i].name2+'</p></div></div>';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.paiming[i].img3+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.paiming[i].img3+'" data-preview-src="" data-preview-group="'+dataurl.paiming[i].team_id+'"/></div><p class="name">'+dataurl.paiming[i].name3+'</p></div></div>';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.paiming[i].img4+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.paiming[i].img4+'" data-preview-src="" data-preview-group="'+dataurl.paiming[i].team_id+'"/></div><p class="name">'+dataurl.paiming[i].name4+'</p></div></div>';
						rank+='</div></div></div>';
      				}
      				$(".new-game-rank").append(rank);
      				mui.previewImage();
      				$(".new-game-rank").on("tap","a",function(){
						mid=$(this).attr("data-id");
						mui.openWindow({
							url:'integralrank-page02.html',
							id:'integralrank-page02.html',
							createNew:true,
							show: {
								autoShow: true,
								aniShow: 'slide-in-right',
								duration: 200,
							},
							extras:{
								mid:mid
							}
						});
					})
      				//赛事回顾
      				var ss="";
      				for(var i=0;i<dataurl.list.length;i++){
      					ss+='<dl class="mui-clearfix"><a data-id="'+dataurl.list[i].id+'">';
		        		ss+='<dt><img src="'+H_SRC+''+dataurl.list[i].img+'"/></dt>';
		        		ss+='<dd><h4 class="mui-ellipsis-2"><span>帖子</span>'+dataurl.list[i].intro+'</h4>';
	        			ss+='<p>'+dataurl.list[i].c_time+'</p></dd></a></dl>';
      				}
      				$(".experience-content").html(ss);
      				$(".experience-content").on("tap","a",function(){
						var nid=$(this).attr("data-id");
						mui.openWindow({
							url:'honor-team-page.html',
							id:'honor-team-page.html',
							createNew:true,
							extras:{
								nid:nid
							},
							show: {
								autoShow: true,
								aniShow: 'slide-in-right',
								duration: 200
							}
						});
					})
      				
				}else{
					mui.toast(data.msg);
				}
			},
			error:function(){
				
			}
		}) 
		
		function shareWeixinMessage(type){
			var type=type;
			if(type==1){
				var secne="WXSceneSession"
			}else{
				var secne="WXSceneTimeline"
			}
			sharewx.send( 
				{ 
					title:"团体赛年度排行榜",
					content:"团体赛年度排行榜", 
					href:H_SRC+'/honor_team',
					thumbs: [H_SRC+'/defaultimg.jpg'], 
		        	pictures: [H_SRC+'/defaultimg.jpg'], 
					extra:{scene:secne}
				}, 
				function(){
					mask.close();
					$(".shareWx").addClass("mui-hidden");
					mui.toast( "分享成功！" );
				}, function(e){
					mask.close();
					$(".shareWx").addClass("mui-hidden");
					mui.toast( "取消分享");
				}
			);
		}
    </script>
</body>
</html>